/**
 *
 */
var myCtrl = angular.module("myApp.recruitment", []);
myCtrl.controller('recruitmentController', ["$rootScope", "$scope", "$filter", "recruitmentService", "LoadingDataProject", "$state", "$stateParams", function ($rootScope, $scope, $filter, recruitmentService, LoadingDataProject, $state, $stateParams) {

    $scope.queryRecommendInfo = function () {
        recruitmentService.queryRecommendInfo().success(function (result) {
            if (result.code == 0) {
                $scope.items = result.data;
            }
        })

        recruitmentService.recommendCount().success(function (result) {
            if (result.code == 0) {
                $scope.countItems = result.data;
            }
        })
    }

    $scope.queryCoolRecommend = function () {

        var param = {};
        $scope.data = new LoadingDataProject("/recruitment/coolRecommend/", param);
    }

    $scope.querySecondRecommendInfo = function () {
        $scope.custId = $stateParams.custId;
        $scope.custName = $stateParams.custName;
        recruitmentService.queryRecommendInfo($scope.custId).success(function (result) {
            if (result.code == 0) {
                $scope.items = result.data;
            }
        })

        var param = {subcustId: $scope.custId};
        $scope.data = new LoadingDataProject("/recruitment/findIntegralBysubcustId/", param);

    }

    $scope.queryThirdRecommendInfo = function () {
        $scope.custId = $stateParams.custId;
        $scope.custName = $stateParams.custName;
        var param = {subcustId: $scope.custId};
        $scope.data = new LoadingDataProject("/recruitment/findIntegralBysubcustId/", param);
    }

}])